/*
 * $Id$
 */
package corejs.expr;

import corejs.rt.ActivationRecord;
import corejs.rt.Str;

import corejs.util.XmlPrinter;

/**
 *
 * @author myang
 */
public class StringExpr implements Expression {

   private String _text;

   public StringExpr(final String s) {
      _text = s;
   }

   public String text() {
      return _text;
   }

   @Override
   public String eval(final ActivationRecord scope) {
      return _text;
   }
   
   @Override
   public void print(final XmlPrinter printer) {
      printer.print("string", _text);
   }

   @Override
   public String toString() {
      return _text;
   }

   @Override
   public Str accept(final ExpressionVisitor visitor) {
      return visitor.visitString(_text);
   }
}
